\(\int \frac {x^2 (A+B x^2)}{a+b x^2} \, dx\) [60]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 58 \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=\frac {(A b-a B) x}{b^2}+\frac {B x^3}{3 b}-\frac {\sqrt {a} (A b-a B) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{b^{5/2}} \]

[Out]

(A*b-B*a)*x/b^2+1/3*B*x^3/b-(A*b-B*a)*arctan(x*b^(1/2)/a^(1/2))*a^(1/2)/b^(5/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {470, 327, 211} \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=-\frac {\sqrt {a} (A b-a B) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{b^{5/2}}+\frac {x (A b-a B)}{b^2}+\frac {B x^3}{3 b} \]

[In]

Int[(x^2*(A + B*x^2))/(a + b*x^2),x]

[Out]

((A*b - a*B)*x)/b^2 + (B*x^3)/(3*b) - (Sqrt[a]*(A*b - a*B)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(5/2)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p + 1) + 1))), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {B x^3}{3 b}-\frac {(-3 A b+3 a B) \int \frac {x^2}{a+b x^2} \, dx}{3 b} \\ & = \frac {(A b-a B) x}{b^2}+\frac {B x^3}{3 b}-\frac {(a (A b-a B)) \int \frac {1}{a+b x^2} \, dx}{b^2} \\ & = \frac {(A b-a B) x}{b^2}+\frac {B x^3}{3 b}-\frac {\sqrt {a} (A b-a B) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{b^{5/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.98 \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=\frac {(A b-a B) x}{b^2}+\frac {B x^3}{3 b}+\frac {\sqrt {a} (-A b+a B) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{b^{5/2}} \]

[In]

Integrate[(x^2*(A + B*x^2))/(a + b*x^2),x]

[Out]

((A*b - a*B)*x)/b^2 + (B*x^3)/(3*b) + (Sqrt[a]*(-(A*b) + a*B)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(5/2)

Maple [A] (verified)

Time = 2.60 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.88

method result size
default \(\frac {\frac {1}{3} b B \,x^{3}+A b x -B a x}{b^{2}}-\frac {a \left (A b -B a \right ) \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{b^{2} \sqrt {a b}}\) \(51\)
risch \(\frac {B \,x^{3}}{3 b}+\frac {A x}{b}-\frac {B a x}{b^{2}}+\frac {\sqrt {-a b}\, \ln \left (-\sqrt {-a b}\, x -a \right ) A}{2 b^{2}}-\frac {\sqrt {-a b}\, \ln \left (-\sqrt {-a b}\, x -a \right ) B a}{2 b^{3}}-\frac {\sqrt {-a b}\, \ln \left (\sqrt {-a b}\, x -a \right ) A}{2 b^{2}}+\frac {\sqrt {-a b}\, \ln \left (\sqrt {-a b}\, x -a \right ) B a}{2 b^{3}}\) \(129\)

[In]

int(x^2*(B*x^2+A)/(b*x^2+a),x,method=_RETURNVERBOSE)

[Out]

1/b^2*(1/3*b*B*x^3+A*b*x-B*a*x)-a*(A*b-B*a)/b^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 129, normalized size of antiderivative = 2.22 \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=\left [\frac {2 \, B b x^{3} - 3 \, {\left (B a - A b\right )} \sqrt {-\frac {a}{b}} \log \left (\frac {b x^{2} - 2 \, b x \sqrt {-\frac {a}{b}} - a}{b x^{2} + a}\right ) - 6 \, {\left (B a - A b\right )} x}{6 \, b^{2}}, \frac {B b x^{3} + 3 \, {\left (B a - A b\right )} \sqrt {\frac {a}{b}} \arctan \left (\frac {b x \sqrt {\frac {a}{b}}}{a}\right ) - 3 \, {\left (B a - A b\right )} x}{3 \, b^{2}}\right ] \]

[In]

integrate(x^2*(B*x^2+A)/(b*x^2+a),x, algorithm="fricas")

[Out]

[1/6*(2*B*b*x^3 - 3*(B*a - A*b)*sqrt(-a/b)*log((b*x^2 - 2*b*x*sqrt(-a/b) - a)/(b*x^2 + a)) - 6*(B*a - A*b)*x)/
b^2, 1/3*(B*b*x^3 + 3*(B*a - A*b)*sqrt(a/b)*arctan(b*x*sqrt(a/b)/a) - 3*(B*a - A*b)*x)/b^2]

Sympy [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.55 \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=\frac {B x^{3}}{3 b} + x \left (\frac {A}{b} - \frac {B a}{b^{2}}\right ) - \frac {\sqrt {- \frac {a}{b^{5}}} \left (- A b + B a\right ) \log {\left (- b^{2} \sqrt {- \frac {a}{b^{5}}} + x \right )}}{2} + \frac {\sqrt {- \frac {a}{b^{5}}} \left (- A b + B a\right ) \log {\left (b^{2} \sqrt {- \frac {a}{b^{5}}} + x \right )}}{2} \]

[In]

integrate(x**2*(B*x**2+A)/(b*x**2+a),x)

[Out]

B*x**3/(3*b) + x*(A/b - B*a/b**2) - sqrt(-a/b**5)*(-A*b + B*a)*log(-b**2*sqrt(-a/b**5) + x)/2 + sqrt(-a/b**5)*
(-A*b + B*a)*log(b**2*sqrt(-a/b**5) + x)/2

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.91 \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=\frac {{\left (B a^{2} - A a b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} b^{2}} + \frac {B b x^{3} - 3 \, {\left (B a - A b\right )} x}{3 \, b^{2}} \]

[In]

integrate(x^2*(B*x^2+A)/(b*x^2+a),x, algorithm="maxima")

[Out]

(B*a^2 - A*a*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b^2) + 1/3*(B*b*x^3 - 3*(B*a - A*b)*x)/b^2

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.98 \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=\frac {{\left (B a^{2} - A a b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} b^{2}} + \frac {B b^{2} x^{3} - 3 \, B a b x + 3 \, A b^{2} x}{3 \, b^{3}} \]

[In]

integrate(x^2*(B*x^2+A)/(b*x^2+a),x, algorithm="giac")

[Out]

(B*a^2 - A*a*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b^2) + 1/3*(B*b^2*x^3 - 3*B*a*b*x + 3*A*b^2*x)/b^3

Mupad [B] (verification not implemented)

Time = 5.00 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.21 \[ \int \frac {x^2 \left (A+B x^2\right )}{a+b x^2} \, dx=x\,\left (\frac {A}{b}-\frac {B\,a}{b^2}\right )+\frac {B\,x^3}{3\,b}+\frac {\sqrt {a}\,\mathrm {atan}\left (\frac {\sqrt {a}\,\sqrt {b}\,x\,\left (A\,b-B\,a\right )}{B\,a^2-A\,a\,b}\right )\,\left (A\,b-B\,a\right )}{b^{5/2}} \]

[In]

int((x^2*(A + B*x^2))/(a + b*x^2),x)

[Out]

x*(A/b - (B*a)/b^2) + (B*x^3)/(3*b) + (a^(1/2)*atan((a^(1/2)*b^(1/2)*x*(A*b - B*a))/(B*a^2 - A*a*b))*(A*b - B*
a))/b^(5/2)